﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Cinchoo.Core.IO;
using System.Data.SqlClient;
using System.Data.SQLite;

namespace Cinchoo.Core.ETL
{
    [XmlRoot("sqliteCommandTask")]
    public class ChoETLSQLiteCommandTaskDef : ChoETLTaskDef
    {
        [ChoETLTaskDefPropertyInfo("CONNECTION_STRING")]
        [XmlAttribute("connectionString")]
        public string ConnectionString;

        [ChoETLTaskDefPropertyInfo("SQL", IsRequired = true)]
        [XmlAttribute("sql")]
        public string Sql;

        protected override ChoETLTask Construct(ChoETLWorkflow workflow)
        {
            return new ChoETLSQLiteCommandTask(ConnectionString, Sql);
        }
    }
}
